package com.utils;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 
/**
* Created by Administrator on 2017/12/20.
 */
 
@Component
public class Timing {
	
    @Scheduled(cron = "0/2 * * * * ?")//每2s执行一次
    //@Scheduled(cron = "0 0 10 * * ?")//定时到每天10点
    //@Scheduled(cron = "0 0/1 * * * ?")//每分钟执行一次
    public void test()
    {	//可以在这里写业务逻辑
        System.out.println("hello world!");
    }
}
